﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TrackSystem.Entities.DataShaping
{
    public static class DataShaperExtensions
    {
        public static IEnumerable<dynamic> ShapeData<T>(this IEnumerable<T> source, string? fieldsString)
        {
            var dataShaper = new DataShaper<T>(fieldsString ??= "");
            return dataShaper.FetchData(source);
        }

        public static dynamic ShapeData<T>(this T source, string fieldsString)
        {
            var dataShaper = new DataShaper<T>(fieldsString);
            return dataShaper.FetchData(source);
        }
    }
}
